home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
10,000 Great Games
/
10,000 Great Games.iso
/
Product
/
66
/
data1.cab
/
Source_Files
/
Src
/
Music.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
2000-01-16
|
756b
|
48 lines
#include "stdafx.h"
int no_music = FALSE;
void init_music()
{
if (!no_music)
mciSendString("close all", 0, 0, 0);
}
void deinit_music()
{
if (!no_music)
mciSendString("close all", 0, 0, 0);
}
void play_music(char *name, int loop)
{
if (!no_music)
{
stop_music();
if (mciSendString(construct("open %s.MID type sequencer alias MUSIC", name), 0, 0, 0) != 0)
{
no_music = TRUE;
}
else
{
if (loop)
replay_music();
else
mciSendString("play MUSIC from 0", 0, 0, 0);
}
}
}
void replay_music()
{
if (!no_music)
mciSendString("play MUSIC from 0 notify", 0, 0, mainwindowhandle);
}
void stop_music()
{
if (!no_music)
mciSendString("close MUSIC", 0, 0, 0);
}